function Tab(el,options = {}){
this.el = document.querySelector(el)

    this.init()//this==tab1 tab2
}
Tab.prototype.init = function(){
    //调用原型方法
    this.titleOver()//this 实例化对象
   
}
Tab.prototype.titleOver = function(){
    //1获取自身标题 this===实例化对象
    let liObjs = this.el.querySelectorAll('ul li')
    //2遍历
    liObjs.forEach((item,i) => {
        //3挨个绑定移入事件
        item.onmouseover =()=> {
            this.el.querySelector('ul li.active').className=''
            item.className='active'
            //同步内容
            this.changeCotent(i)
        }
    })
}
Tab.prototype.changeCotent = function(i){
    this.el.querySelector("ol li.active").className = ""
    this.el.querySelector(`ol li:nth-of-type(${i+1})`).className="active"
}
export default Tab;